package com.gt.admin.controller;

import com.gt.common.core.controller.BaseController;
import com.gt.common.core.domain.AjaxResult;
import com.gt.admin.domain.SicknessMenu;
import com.gt.admin.service.ISicknessMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "sc-")
@RestController
@RequestMapping("/sicknessMenu")
public class SicknessMenuController extends BaseController {

    @Autowired
    private ISicknessMenuService sicknessMenuService;

    //获取树状列表
    @ApiOperation("获取树状列表")
    @GetMapping
    public AjaxResult list(SicknessMenu sicknessMenu){
        List<SicknessMenu> sicknessMenus = sicknessMenuService.selectList(sicknessMenu);
        return AjaxResult.success(sicknessMenuService.buildMenuTree(sicknessMenus));
    }
}
